def HCF(a, b):
   while b != 0:
       a, b = b, a % b
   return a

nums = []

def calc():
    
    nums = []
    for i in range (5):
        nums.append(int(input("Enter the numbers:")))
       
    nums.sort()

    difs = []

    for i in range (4):
        dif = nums[i+1]-nums[i]
        difs.append(dif)

    table = HCF(HCF(difs[0],difs[1]),HCF(difs[2],difs[3]))

    print("It's the", table, "times table")
    shift = nums[0]%table
    print("The shift is", shift)

calc()

       
#Program written by Alejandro Bürg

